import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'navbars',
        component: () => import("../components/navbars"),
        redirect: '/Home',
        children: [
            {
                path: 'Home',
                name: 'Home',
                component: Home
            },
            {
                path: 'about',
                name: 'about',
                component: () => import('@/views/About')
            },
            {
                path: 'discover',
                name: 'discover',
                component: () => import('@/views/discover')
            },
            {
                path: 'order',
                name: 'order',
                component: () => import('@/views/order')
            },
        ]
    },
    {
        path: '/search',
        name: 'search',
        component: () => import('@/components/search')
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
